package com.cmbchina.logistics.shipping.service;

import com.cmbchina.logistics.shipping.antiCorruption.packaging.IPackagingService;
import com.cmbchina.logistics.shipping.entity.Package;
import com.cmbchina.logistics.shipping.entity.PackagingCapabilities;
import com.cmbchina.logistics.shipping.entity.Product;
import com.cmbchina.logistics.shipping.entity.Zone;

import java.util.List;

/**
 * 运输服务
 */
public class CourierService {
    private IPackagingService packagingService;
    private CapabilitiesService capabilitiesService;

    /**
     * 计算最佳运输成本
     * @param items 货件记录
     * @param source 寄件地址
     * @param destination 收货地址
     * @return
     */
    public double GetQuote (List<Product> items, Zone source, Zone destination) {
        PackagingCapabilities packagingCapabilities = capabilitiesService.getPackagingCapabilities (source);
        List<Package> packages = packagingService.packageItems (items, packagingCapabilities.getContainers());
        //省略航运相关业务逻辑……
        return 1.11;
    }
}
